package com.yincheng.oes.attachment.mapper;

import com.yincheng.oes.attachment.entity.Attachment;
import com.yincheng.oes.business.model.query.DownloadListReq;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface AttachmentMapper {
    int deleteByPrimaryKey(String attachmentId);

    int insert(Attachment record);

    Attachment selectByPrimaryKey(String attachmentId);

    int updateByPrimaryKey(Attachment record);

    List<Attachment> selectByAreaId(String areaId);

    /**
     * 根据根目录KEY获取附件存储根目录
     *
     * @param rootKey
     * @return
     */
    String getRootDirectory(String rootKey);

    int countByParam(DownloadListReq req);

    List<Attachment> selectByParam(DownloadListReq req);

    int deleteTmpFile(Date date);
}
